package tx.bj12320.model.enums;

import java.util.LinkedHashMap;

import cn.org.rapid_framework.lang.enums.EnumBase;
import cn.org.rapid_framework.lang.enums.EnumBaseUtils;

public enum BooleanEnum implements EnumBase<Long>{
	TRUE(new Long(1),"是"),
	FALSE(new Long(0),"否")
	;

	private final Long code;
	private final String desc;
	BooleanEnum(Long code,String desc) {
		this.code = code;
		this.desc = desc;
	}

	public Long getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

	public static BooleanEnum getByCode(Long code) {
		return EnumBaseUtils.getByCode(code, values());
	}

	public static BooleanEnum getRequiredByCode(Long code) throws IllegalArgumentException {
		return EnumBaseUtils.getRequiredByCode(code, values());
	}

	@SuppressWarnings("unchecked")
	public static LinkedHashMap<String, String> toMap() {
	    return EnumBaseUtils.toMap(values());
	}
}